home *** CD-ROM | disk | FTP | other *** search
-
-
- x
-
- x
-
- åWhat Does Menu Events Do?
-
-
-
- Menu Events is a system extension. Once you have placed it in your
-
- Extensions folder and restarted your Macintosh, it adds a small suite of
-
- Apple events (ΓÇ£Menu eventsΓÇ¥) to the set supported by every
-
- high-level-event-aware application. Also, if the Caps Lock key is down,
-
- it alters menu selection logic so that the selection is recorded as a Menu
-
- event. This capability allows a script editor to record menu actions as
-
- script commands.
-
-
-
- Many people are justly wary of control panels and system extensions,
-
- because of the conflicts they often cause with System software and with
-
- each other. These conflicts usually result from competitive trap patching.
-
-
- Menu Events installs a GetNextEvent filter and patches the MenuSelect
-
- trap at system startup to enable the Apple event recording capability, and
-
- installs an Apple event handler in the system dispatch table. The Apple
-
- event handler cannot conflict with any other, because it is bound
-
- specifically to the Menu event class. Menu Events does patch some traps
-
- ΓÇ£on the flyΓÇ¥ to simulate menu selection, but the patches remove
-
- themselves immediately.
-
-
- There are three events defined in the suite, and they work as follows.
-
- See the section entitled ΓÇ£Menu Events SuiteΓÇ¥ for more information on the
-
- Menu Events suite.
-
-
-
-
- xQuery Menu List Event
-
-
- This event, with no parameters, queries the menu list of the target
-
- application. If the application is high-level-event-aware, not
-
- background-only, and has a menu bar, it will return a list of records, each
-
- containing a menu ID (integer), a title (string), an enable/disable
-
- (Boolean), and a menu definition procedure resource ID (integer)
-
- parameter. If you do not know the IDs or titles of the target applicationΓÇÖs
-
- menus, this is one way to find out. (Another way is to press the Caps
-
- Lock key and record menu actions using a script editor; yet another is to
-
- use the Menu Grabber application, also part of AWOL Utilities.) Be aware
-
- that menu IDs do not have to agree with 'MENU' resource IDs, though they
-
- often do.
-
-
- See the section entitled ΓÇ£Suggestions for UseΓÇ¥ for more information on
-
- Menu Grabber.
-
-
- System menus (Keyboard, Help, Application), hierarchical menus, and
-
- pop-up menus do not appear in this list, but the Apple menu does.
-
-
- NOTE: The standard menu definition procedure ('MDEF') resource ID is 0.
-
- A value of -1 indicates that the menu definition procedure is not a
-
- resource. Non-standard menu definition procedures may have abnormal
-
- ways of counting, disabling, and displaying menu items, so be careful with
-
- them.
-
-
-
-
- xQuery Menu Event
-
-
- This event, given a menu ID (integer) and/or menu title (string)
-
- parameter, queries the items of a certain target application menu. If the
-
- application has a menu with that ID and/or title, be it a regular, system,
-
- hierarchical, or pop-up menu, it will return a list of records, one per
-
- menu item, each containing a menu item ID (integer), an item text
-
- (string), an enable/disable (Boolean), a mark character (integer), an icon
-
- ID (integer), a style value (integer), and a Command character (integer)
-
- parameter. The items are numbered starting from 1 at the top end of the
-
- menu. Separators appear as disabled items with an item text of ΓÇ£-ΓÇ¥.
-
-
-
- This event simulates a simple click in the applicationΓÇÖs menu bar, to force
-
- it to bring its menus up to date.
-
-
- You may optionally include Boolean parameters to indicate which modifier
-
- keys (Shift, Control, Option, Command) are pressed at the time of the
-
- simulated menu bar click, in case this makes a difference in the content of
-
- the menu.
-
-
- This event does work for menus which use a non-standard menu definition
-
- procedure ('MDEF'), but the results may or may not reflect what you see
-
- when you pull down the menu, depending on how the procedure was
-
- programmed.
-
-
- This event brings the target application to the front before forcing the
-
- menu bar click upon it. If the sender was on the same machine, and was
-
- previously in front, it returns to the front after the menu query is
-
- complete.
-
- See the section entitled ΓÇ£How Does Menu Events Work?ΓÇ¥ for more
-
- information about the method by which Menu Events activates the target
-
- application.
-
-
-
-
- xSelect Menu Item Event
-
-
- This event, given a menu ID (integer) and/or menu title (string)
-
- parameter and a menu item ID (integer) and/or menu item text (string)
-
- parameter, asks the application to act as though the user pulled down that
-
- menu and selected that item. This does not work for the Keyboard and
-
- Application menus, which are not under the control of the application, nor
-
- for the upper (System-defined) part of the Help menu, but it works for
-
- any regular, application-defined, enabled menu item.
-
-
-
- If you use the menu item text parameter to specify the menu item to
-
- select, be sure to match any special characters in the text, especially the
-
- ellipsis ('…') character which often appears at the end of the string,
-
- which is not the same as three period characters, despite its appearance.
-
-
- You may optionally include Boolean parameters to indicate which modifier
-
- keys (Shift, Control, Option, Command) are pressed at the time of the
-
- simulated menu item selection, in case this makes a difference in the
-
- effect of the selection.
-
-
- This event does work for menus which use a non-standard menu definition
-
- procedure ('MDEF'), but the results may or may not reflect what happens
-
- when you select from the menu, depending on how the procedure was
-
- programmed.
-
-
- This event brings the target application to the front before forcing the
-
- menu selection upon it. If the sender was on the same machine, and was
-
- previously in front, it returns to the front after the menu action is
-
- complete.
-
- See the section entitled ΓÇ£How Does Menu Events Work?ΓÇ¥ for more
-
- information about the method by which Menu Events activates the target
-
- application.
-
-
-
-